<template>
  <div class="contaniner">
    <error-tip/>
    <div v-if="!errorCode">
       <card-list :data="yearData"/>
    </div>
  </div>

</template>

<script>
import { onMounted, computed } from 'vue';
import getData from "@/services"
import { useStore } from 'vuex';

import CardList from '@/components/YearPage/YearList';
import ErrorTip from '@/components/ErrorTip/ComErr'


export default {
    name: 'Year',
    components:{
      CardList,
      ErrorTip 
    },
    setup(){
      const store = useStore(),
            state = store.state;

      onMounted(()=>{
        getData( store,'year',"2019")
      });
      return {
       yearData: computed(()=>state.yearData),
       errorCode: computed(()=>state.errorCode)
      }
    }

}
</script>

<style>

</style>